package com.colin.datamove.job;

import com.colin.datamove.service.MoveService;
import com.colin.datamove.util.EmailUtils;
import com.colin.datamove.util.LogUtil;
import org.apache.commons.lang3.exception.ExceptionUtils;

public class MoveJob implements Runnable {

    private MoveService moveService;
    private int pmc;

    public MoveJob(MoveService moveService, int pmc) {
        this.moveService = moveService;
        this.pmc = pmc;
    }

    @Override
    public void run() {
        LogUtil.info("MoveJob begin...");
        try{
            moveService.moveJob(pmc);
        }catch (Exception e){
            EmailUtils.sendAlert(ExceptionUtils.getStackTrace(e));
            LogUtil.error("MoveJob_error", e);
        }
    }
}
